'use strict'
import { Notification } from 'element-ui'

export const defaultTime = 2000

export const message = {
  success: function (str, time = defaultTime) {
    Notification.success({
      title: '通知',
      duration: time,
      message: str
    })
  },
  error: function (str, time = defaultTime) {
    Notification.error({
      title: '通知',
      duration: time,
      message: str
    })
  },
  info: function (str, time = defaultTime) {
    Notification.info({
      title: '通知',
      duration: time,
      message: str
    })
  },
  warning: function (str, time = defaultTime) {
    Notification.warning({
      title: '通知',
      duration: time,
      message: str
    })
  }
}
